All Questions
134 questions
1vote
3answers
293views
Sed command not matching and replacing pattern on multi line xml
I have many XML files as below where i would like to replace a string with a new string. I cannot seem to get the sed command to work on the xml files. <form version="1.1" theme="...
1vote
2answers
71views
Use sed to insert a character in an xml file
I have an xml file with content following this format: <type:color>000000</type:color> <type:color>FFFFFF</type:color> The information within the tags are hex colors (many ...
-2votes
1answer
72views
Parse txt file on basis of occurrence of a tag in Linux
I am trying to parse a txt file containing xml "messages"in linux, something like this <Document abc xyz .....> <hji> xyz </hji> </Document> <Document abc xyz ........
-1votes
3answers
129views
sed inline not working to modify XML-style input
the problem is that I cannot put the complete command on a line with SED, I had already done it but with those file it does not work: my exemple : <file>Documents/time/text1</file> //2X ...
3votes
3answers
183views
SED command to delete a forward slash "/" between 2 tags
I am using Linux, and I want to use sed to delete a forward slash (/) between 2 tags. From this: input.xml... <file>/text</file> <file>/text2</file> <file>/text</file&...
-1votes
3answers
109views
sed command gets me error Label too long: on solaris
Given database name oltt206 or DB01 i wish to extract its respective username, password and connection string from the xml below: wladmin@myremhost:/tmp$ cat /web/bea_apps/uat/Tomcat_Home_v9.0.56/...
0votes
1answer
170views
Using sed to search multiple strings in XML file
I need to filter a big file XML and find the string using a multiple conditions. I need a filter a email if cnisfCF equal true and natg_passwordAlreadyResetedPostMigration is true. Anyone can help ? &...
1vote
2answers
2kviews
How may I replace a string in an XML file?
I am trying to replace the string inside an XML file. From <hello="value" exampleno="xxxx:yyyyyyyy/dd=eeeee-ffffff,aa=bb ccc,dd=eeee,ff=gggg,hh=iii,jj=kkk,ll=mmmm" /> I want ...
2votes
1answer
785views
Insert contents of file into XML attribute
I have a text file called branch.txt: $ cat branch.txt DEMAND_NAME-CR-1234 DEMAND_NAME-CR-8970 Using the above branch name, I have to find and replace some values using a sed command: branch_name=`(...
0votes
3answers
205views
How to get all numbers AND IPs from string using regex?
Let's say I have the following example string: <ETH0_IP><![CDATA[10.0.100.10]]></ETH0_IP> I would like to extract the first number and the IP in the following format: 0 10.0.100.10 ...
-2votes
2answers
402views
I need to update a tag <abc><\abc> with variables from another file. Output should be an xml file with all those values comma separated within abc tag
I need help updating an xml file, file1.xml which has a tag name <abc> <\abc>. The file2.txt has numbers fixed length numbers (1 number in each row): 1234 5678 1435 I need output to a ...
-1votes
1answer
56views
Change the version number from 97 to 98 in an XML file [closed]
I want to change the version number with respect to the ip. For example for this ip 10.228.134.226, it should change the version number from 97 to 98 <qa:browsers> <browser name="...
0votes
1answer
1kviews
replacing value in xml file using sed value from variable missing ""s
hi can some one please help me here i am trying to replace value in tomcat server.xml file username using sed command <Resource username="user1" password="xxxxxxxx"/> below ...
0votes
2answers
156views
Sed an XML balise
Please, I have this xml balise inside my test.xml file <ingressAnnotations>nginx.ingress.kubernetes.io/server-snippet: | location @custom_503 { return 503 "<html> &...
1vote
4answers
400views
Problems with replacing XML tag contents using sed
I have the following XML piece: <value id="1" creatorId="0" creationTime="1639487132" expirationTime="1639573532">+380554446363</value> <value id=...